/*
 * @Author: 18163104359 2205227953@qq.com
 * @Date: 2024-01-22 16:24:32
 * @LastEditors: 18163104359 2205227953@qq.com
 * @LastEditTime: 2024-01-23 15:35:55
 * @FilePath: /umi/src/layouts/components/Logo.jsx
 * @Description:
 */
import { connect, useDispatch, history } from "umi";
import "./Logo.less";
import logo from "@/assets/yay.jpg";
const LogoPage = (props) => {
  const { appConfig } = props;

  const isLogo = () => {
    if (appConfig.collapsed) {
      return <img src={logo} alt="" />;
    } else {
      return (
        <div
          className="title"
          style={{ background: appConfig.siderMenuTheme == "light" ? "#2f77f8" : "#3e3838" }}
        >
          {process.env.APP_TITLE}
        </div>
      );
    }
  };

  return (
    <div className="logoBox" onClick={() => history.push("/index")}>
      {isLogo()}
    </div>
  );
};
export default connect((state) => ({ appConfig: state.appConfig }))(LogoPage);
